package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DagPerformanceMapper;
import com.ruoyi.system.domain.DagPerformance;
import com.ruoyi.system.service.IDagPerformanceService;

/**
 * DAG性能评测Service业务层处理
 * 
 * @author NovaTian
 * @date 2022-05-12
 */
@Service
public class DagPerformanceServiceImpl implements IDagPerformanceService 
{
    @Autowired
    private DagPerformanceMapper dagPerformanceMapper;

    /**
     * 查询DAG性能评测
     * 
     * @param uuid DAG性能评测主键
     * @return DAG性能评测
     */
    @Override
    public DagPerformance selectDagPerformanceByUuid(String uuid)
    {
        return dagPerformanceMapper.selectDagPerformanceByUuid(uuid);
    }

    /**
     * 查询DAG性能评测列表
     * 
     * @param dagPerformance DAG性能评测
     * @return DAG性能评测
     */
    @Override
    public List<DagPerformance> selectDagPerformanceList(DagPerformance dagPerformance)
    {
        return dagPerformanceMapper.selectDagPerformanceList(dagPerformance);
    }

    /**
     * 新增DAG性能评测
     * 
     * @param dagPerformance DAG性能评测
     * @return 结果
     */
    @Override
    public int insertDagPerformance(DagPerformance dagPerformance)
    {
        dagPerformance.setUuid(IdUtils.simpleUUID());
        dagPerformance.setCreateTime(DateUtils.getNowDate());
        return dagPerformanceMapper.insertDagPerformance(dagPerformance);
    }

    /**
     * 修改DAG性能评测
     * 
     * @param dagPerformance DAG性能评测
     * @return 结果
     */
    @Override
    public int updateDagPerformance(DagPerformance dagPerformance)
    {
        dagPerformance.setUpdateTime(DateUtils.getNowDate());
        return dagPerformanceMapper.updateDagPerformance(dagPerformance);
    }

    /**
     * 批量删除DAG性能评测
     * 
     * @param uuids 需要删除的DAG性能评测主键
     * @return 结果
     */
    @Override
    public int deleteDagPerformanceByUuids(String[] uuids)
    {
        return dagPerformanceMapper.deleteDagPerformanceByUuids(uuids);
    }

    /**
     * 删除DAG性能评测信息
     * 
     * @param uuid DAG性能评测主键
     * @return 结果
     */
    @Override
    public int deleteDagPerformanceByUuid(String uuid)
    {
        return dagPerformanceMapper.deleteDagPerformanceByUuid(uuid);
    }
}
